<?php 


if($session->is_logged_in()) {
  redirect_to("/view/admin/index.php");
}
$aloginusername ="";
$aloginpassword ="";
$message ="";

if (isset($_POST['alogin'])) { // Form has been submitted.

   
  $aloginusername = trim($_POST['aloginusername']);
  $aloginpassword = trim($_POST['aloginpassword']);
  $activeget =  $_GET['activ'];
  
  $message = $user_controller->activateAccount($aloginusername,$aloginpassword,$activeget); 
}      
echo $message;
        ?> 

<div id="aktiveringsdiv"><h1>AKTIVER DIN KONTO!</h1></div>

<form id="ulogin" method="post" >
     

      <label> Brukernavn/epost</label> <em>*</em><input type="email" name="aloginusername" size="25" required="required" minlength="2" value="<?php echo htmlentities($aloginusername);?>" /><br />
       
        <p>
       <br/>
       <label> Passord </label><em>*</em> <input type="password" name="aloginpassword" required="required" minlength="6" value="<?php echo htmlentities($aloginpassword); ?>"  placeholder="Skriv passord"/>
       </p>
       
        <p>
 <input type="submit" name="alogin" value="Send inn"/> 
        </p>
 </form>